// 组件形式的写法
import About from '@/views/About'
import Home from '@/views/Home'
import { BrowserRouter, Route, Routes, Navigate} from 'react-router-dom'
import App from '../App'
// 两种路由模式，  BrowserRouter（History模式），HashRouter（Hash模式）
const baseRouter = () =>(
    <BrowserRouter>
        <Routes>
            <Route path='/' element={<App/>}>
                {/* 配置用户访问重定向,到home路径 */}
                <Route path='/' element={<Navigate to='./home'></Navigate>}></Route>
                <Route path='/home' element={<Home />}></Route>
                <Route path='/about' element={<About />}></Route>
            </Route>
        </Routes>
    </BrowserRouter>
)
    


export default baseRouter